/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.portlet.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import com.portlet.model.nhanvien;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing nhanvien in entity cache.
 *
 * @author Thi
 * @see nhanvien
 * @generated
 */
public class nhanvienCacheModel implements CacheModel<nhanvien>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(13);

		sb.append("{maNhanVien=");
		sb.append(maNhanVien);
		sb.append(", tenNhanVien=");
		sb.append(tenNhanVien);
		sb.append(", gioiTinh=");
		sb.append(gioiTinh);
		sb.append(", ngaySinh=");
		sb.append(ngaySinh);
		sb.append(", maBoPhan=");
		sb.append(maBoPhan);
		sb.append(", maRole=");
		sb.append(maRole);
		sb.append("}");

		return sb.toString();
	}

	public nhanvien toEntityModel() {
		nhanvienImpl nhanvienImpl = new nhanvienImpl();

		if (maNhanVien == null) {
			nhanvienImpl.setMaNhanVien(StringPool.BLANK);
		}
		else {
			nhanvienImpl.setMaNhanVien(maNhanVien);
		}

		if (tenNhanVien == null) {
			nhanvienImpl.setTenNhanVien(StringPool.BLANK);
		}
		else {
			nhanvienImpl.setTenNhanVien(tenNhanVien);
		}

		if (gioiTinh == null) {
			nhanvienImpl.setGioiTinh(StringPool.BLANK);
		}
		else {
			nhanvienImpl.setGioiTinh(gioiTinh);
		}

		if (ngaySinh == Long.MIN_VALUE) {
			nhanvienImpl.setNgaySinh(null);
		}
		else {
			nhanvienImpl.setNgaySinh(new Date(ngaySinh));
		}

		if (maBoPhan == null) {
			nhanvienImpl.setMaBoPhan(StringPool.BLANK);
		}
		else {
			nhanvienImpl.setMaBoPhan(maBoPhan);
		}

		if (maRole == null) {
			nhanvienImpl.setMaRole(StringPool.BLANK);
		}
		else {
			nhanvienImpl.setMaRole(maRole);
		}

		nhanvienImpl.resetOriginalValues();

		return nhanvienImpl;
	}

	public String maNhanVien;
	public String tenNhanVien;
	public String gioiTinh;
	public long ngaySinh;
	public String maBoPhan;
	public String maRole;
}